home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / includ~1.z / includ~1 / widget.h < prev   
Encoding:
C/C++ Source or Header  |  1989-10-11  |  4.4 KB  |  194 lines

  1. #ifndef _WIDGET_H
  2. #define _WIDGET_H
  3.  
  4. /*
  5.  * $Log:    widget.h,v $
  6.  * Revision 1.2  89/08/15  14:26:44  bammi
  7.  * cleanup
  8.  * 
  9.  * Revision 1.2  89/03/05  20:38:42  bammi
  10.  * Port to minixST gcc + gcc curses lib
  11.  * 
  12.  * Revision 1.1  89/03/05  20:31:01  bammi
  13.  * Sources as distributed in comp.sources
  14.  * 
  15.  *
  16.  */
  17.  
  18. /*****************************************************************************
  19. /*  FILE:        widget.h
  20. /*  DATE:        August 1988.
  21. /*  AUTHOR:        Richard A. Culshaw.
  22. /*  DESCRIPTION:    Contains the definitions of the widget structures.
  23. /*            It should be included by all programs that want to
  24. /*            use the widget library.
  25. /* DISCLAIMER:        This file is deemed to be public-domain, on the simple
  26. /*            provisos that this section remains in this file and
  27. /*            that code using it do not do so for monetary gain.
  28. /*            Neither the author, nor the authors employees at the
  29. /*            time of developing this code, accept any liability or
  30. /*            responsibility for the use, abuse or misuse of this
  31. /*            code.
  32. /*****************************************************************************/
  33.  
  34. #include <curses.h>
  35.  
  36. /* definition for command widget entry in linked list */
  37. struct    cmdwid{
  38.             WINDOW        *widget;
  39.             int        id;
  40.             char        msg[100];
  41.             char        acpt;
  42.             int        (*func)();
  43.             int        length;    
  44.             int        x,y;
  45.         int        active;
  46.             struct cmdwid    *next;
  47.         } *cmdlist;
  48.  
  49. /* definition for label widget entry in linked list */
  50. struct    lblwid{
  51.             WINDOW        *widget;
  52.             int        id;
  53.             char        msg[100];
  54.             char        pos;
  55.             int        length;    
  56.         int        difference;
  57.             int        x,y;
  58.             struct lblwid    *next;
  59.         } *lbllist;
  60.  
  61. /* definition for togle widget entry in linked list */
  62. struct     tglwid{
  63.             WINDOW        *widget;
  64.             int        id;
  65.             char        msg[100];
  66.             char        tgl[10][20];
  67.             char        toggle;
  68.             int        cur;
  69.          int         total;
  70.             int        length;
  71.             int         xtgl;
  72.             int        x,y;
  73.         int        active;
  74.             struct tglwid    *next;
  75.         } *tgllist;
  76.  
  77. /* definition for input widget entry in linked list */
  78. struct inpwid{
  79.             WINDOW        *widget;
  80.             int         id;
  81.         char        msg[100];
  82.             char        acpt;
  83.             char        *input;
  84.         int        sofi;
  85.         int        exec;
  86.             int        lofs;
  87.             int        length;
  88.             int        x,y;
  89.         int        active;
  90.             struct inpwid    *next;
  91.         } *inplist;
  92.     
  93. /* linked list of characters used for activating widgets */    
  94. struct chentry {
  95.             char          ch;
  96.             int           type;
  97.             int          id;
  98.         struct chentry    *next;
  99.         } *actlist;
  100.  
  101. /* null entries in the various linked list */
  102. #define NULLCMD        (struct cmdwid *)NULL
  103. #define NULLLBL     (struct lblwid *)NULL
  104. #define NULLTGL     (struct tglwid *)NULL
  105. #define NULLINP     (struct inpwid *)NULL
  106. #define NULLCH         (struct chentry *)NULL
  107.  
  108. /* part of the specifications for label widgets */
  109. #define CENTRE        1
  110. #define    LEFTJUST    2
  111. #define RIGHTJUST    4
  112. #define NOHIGH        8
  113.  
  114. /* the types of the widgets */
  115. #define CMD        1
  116. #define TGL        2
  117. #define LBL        3
  118. #define INP        4
  119.  
  120. #define BLANK        1
  121. #define NOBLANK        0
  122.  
  123. #define NULLWIDGET    0
  124.  
  125. #define EXEC        1
  126. #define NOEXEC        0
  127.  
  128. #define VERTICAL    1
  129. #define HORIZONTAL    2
  130.  
  131. typedef int WIDGET;
  132. typedef int WIDGETTYPE;
  133.  
  134. #ifdef __STDC__
  135. #ifndef __NO_PROTO__
  136.  
  137. int        activate(WIDGET);
  138. int        addtochlist(int, int, WIDGETTYPE);
  139.  
  140. void        boxwidget(WINDOW *, int);
  141.  
  142. int        chactive(WIDGET, int, int);
  143. int        changelblwidget(WIDGET, char *, int);
  144. void        cleartextwindow(void);
  145.  
  146. int        deactivate(WIDGET, int);
  147. int        dehighlight(WIDGET);
  148. void        deletechentry(int);
  149. void        drawcmdwidget(WINDOW *, char *, int, int, int);
  150. void        drawinpwidget(WINDOW *, char *, int, int, int, int);
  151. void        drawlblwidget(WINDOW *, char *, int, int, int, int);
  152. void        drawtextwindow(int);
  153. void        drawtglwidget(WINDOW *, char *, char *, int, int, int);
  154.  
  155. void        endwidgets(void);
  156.  
  157. int        getinput(WIDGET);
  158.  
  159. int        highlight(WIDGET);
  160. void        home(void);
  161.  
  162. void        initialisewidgets(void);
  163.  
  164. void        killcmdwidget(WIDGET);
  165. void        killinpwidget(WIDGET);
  166. void        killlblwidget(WIDGET);
  167. void        killtextwindow(void);
  168. void        killtglwidget(WIDGET);
  169. int        killwidget(WIDGET);
  170.  
  171. int        light(WIDGET, int);
  172.  
  173. WIDGET        mkcmdwidget(char *, int, int (*)(), int);
  174. WIDGET        mkinpwidget(char *, int, char *, int, int, int, int);
  175. WIDGET        mklblwidget(char *, int, int, int);
  176. WIDGET        mktglwidget(char *, int, char **, int, int);
  177.  
  178. int        opentextwindow(int, int);
  179.  
  180. void        report(char *);
  181.  
  182. void        screenrefresh(void);
  183.  
  184. void        togglewidget(WIDGET);
  185. int        tsttglwidget(WIDGET);
  186.  
  187. WIDGET        widgetinput(void);
  188. WIDGETTYPE  widgettype(WIDGET);
  189.  
  190. #endif /* __NO_PROTO__ */
  191. #endif /* __STDC__ */
  192.  
  193. #endif /* _WIDGET_H */
  194.